﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>角色列表</title>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	
	<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
	<link rel="stylesheet" href="lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
	<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
	<script type="text/javascript">
		$(function(){
		//alert("xxx");
			$.getJSON("role/list.action","",function(res){
				//alert(res.length);
				for(var i=0;i<res.length;i++){
					var newtr=$("<tr class='text-c va-m'></tr>");
					newtr.append("<td>"+res[i].ro_id+"</td>");
					newtr.append("<td>"+res[i].ro_name+"</td>");
					newtr.append("<td class='td-status'><a href='javascript:del("+res[i].ro_id+")'><span class='label label-success radius'>删除角色</span></a>|<a href='role/getByid.action?id="+res[i].ro_id+"'><span class='label label-success radius'>查看详情</span></a></td>");
					$("tbody").append(newtr);
				}
			});
		});
		
		function del(id){
			if(confirm("你确定要删除这个角色吗?")){
				location="role/del.action?ro_id="+id;
			}
		}
	</script>
</head>
<body class="pos-r">

<div>
	<div class="page-container">
		
		<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a class="btn btn-primary radius"  href="addRole.jsp"><i class="Hui-iconfont">&#xe600;</i> 添加角色</a></span></div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-bg table-hover table-sort">
				<thead>
					<tr class="text-c">
						<th width="100">角色ID</th>
						<th width="400">角色名称</th>
						<th width="200">操作</th>
					</tr>
				</thead>
				<tbody>
					
				</tbody>
			</table>
		</div>
	</div>
</div>
</body>
</html>